let inps = document.querySelectorAll('input')
let btn = document.querySelector('button')
console.log(inps);

btn.onclick = function () {
    // console.log(inps[0].value);
    axios.post('/user/login', { phone: inps[0].value, pass: inps[1].value }).then((res) => {
        if (res.data.code == 200) {
            // console.log(res.data);
            // console.log(res.data.name);
            console.log(res.data.token);
            localStorage.setItem('token',res.data.token)
            localStorage.setItem('name',res.data.name)
            
            alert(res.data.msg);
            window.location.href = 'http://localhost:2020/index.html'
        }
        else {
            alert(res.data.msg);
        }
    })

}